<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<head>
    <link rel="stylesheet" type="text/css" href="/css/style_member.css" />
    <title>会员注册-笔飞美术作品</title>
    <%@include file="../common/jspcommon.jsp"%>
	<%@include file="../common/js.jsp"%>
	<script type="text/javascript" src="js/jquery.validate.js"></script>
		<%@include file="../common/css.jsp"%>
	<script src="/js/jquery.json-2.2.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="/js/page/pager.js"></script>
</head>
<body>
<div id="box">
     	 <%@include file="../common/header.jsp" %>
    
    <div id="main_div">
        <div class="site_map"><a href="../index.html">首页</a> 》会员注册</div>
        
        <div id="member_div_2">
            <table cellpadding="0" cellspacing="0" class="member_table">
                <tr>
                    <td class="td_1" valign="top">
                        <div class="left_nav">
                        <ul>
	                            <li><a href="/member.htm">控制面板</a></li>
	                            <li	><a href="/memberInfo.htm">个人资料</a></li>
	                            <li	><a href="/mOrders.htm">我的订单</a></li>
	                            <li><a href="/mMade.htm">我的定制</a></li>
	                            <li ><a href="/mActivity.htm">我的活动</a></li>
	                            <li><a href="/mHas.htm">关注收藏欣赏</a></li>
	                            <li class="cur"><a href="mComment.htm">评论管理</a></li>
	                            <li><a href="mPay.htm">支付保证金</a></li>
	                        </ul>
                        </div>
                    </td>
                    <td class="td_2" valign="top">
                        <div>
                            <table cellpadding="3" cellspacing="1" class="member_table2">
                                <tr class="td1">
                                    <td colspan="4" class="td5"><b>评论管理</b></td>
                                </tr>
                                <tr class="td2">
                                    <td style="width:80px;"></td>
                                    <td style="width:150px; font-weight:bold;">产品名称</td>
                                    <td style="width:350px; font-weight:bold;">评论</td>
                                    <td style="font-weight:bold;">日期</td>
                                </tr>
                                <c:forEach items="${model.list}" var="comment" varStatus="vs">
                                <c:if test="${vs.count % 2==1}">
	                                <tr class="td1">
	                                    <td><input   type="checkbox" name="doingCheckbox" commentId="${comment.id}"/></td>
	                                    <td>${comment.title }</td>
	                                    <td>${comment.content }</td>
	                                    <td>2013-04-01</td>
	                                </tr>
	                             </c:if>
	                               <c:if test="${vs.count % 2==0}">
	                                <tr class="td2">
	                                    <td><input  type="checkbox" name="doingCheckbox" commentId="${comment.id}"/></td>
	                                    <td>${comment.title }</td>
	                                    <td>${comment.content }</td>
	                                    <td><fmt:formatDate value="${comment.gmtCreated}" pattern="yyyy-MM-dd  " /></td>
	                                </tr>
	                               </c:if>
                                </c:forEach>
                                <tr>
                                    <td style="text-align:left; padding:10px 0px;" colspan="4"><a href="#" onclick="deleteComment();"><img src="../images/btn_del.jpg" alt="" /></a></td>
                                </tr>
                            </table>
                        </div>
                        <div class="page_div">
                        	<div id="page" class="h_page"></div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <%@include file="../common/footer.jsp" %>	
    </div>
</div>
<script type="text/javascript">
	$(function(){
			$("#page").pager({
				pagenumber : "${model.currentPage}",
				pagecount : "${model.totalPage}",
				buttonClickCallback : function(page) {
					location.href = "/mComment.htm?page="+ page ;
				}
			});
		});
	
	function deleteComment() {
		var doingList = new Array();
		$(":checkbox[name='doingCheckbox']").each(function() {
			if ($(this).attr("checked")) {
				doingList.push($(this).attr("commentId"));
			}
		});
		$.post("/deleteComment.htm", {
			doingList : $.toJSON(doingList)
		}, function(data) {
			if (data == 'success') {
				window.location.href="/mComment.htm";
			}
		});
	}
	</script>
</body>
</html>
